package com.ftz.examinationsystem.util;

public class Result<E> {
    private Integer code;
    private String message;
    private E data;
    private Long count;

    public Result() {
    }

    public Result(Integer state) {
        this.code = state;
    }

    public Integer getCode() {
        return code;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    public void setCode(Integer state) {
        this.code = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }

    public Result(Throwable e) {
        this.message = e.getMessage();
    }

    public Result(Integer code, E data) {
        this.code = code;
        this.data = data;
    }

    public Result(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result(Integer code, String message, E data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result(Integer code, String message, E data, Long count) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.count = count;
    }
}
